var xtMonitorCpuWinDetail;
var xtMonitorCpuFormDetail;
function detailXtMonitorCpu(){
	var record = grid.getSelectionModel().selected;
	if(record.length == 0){
		msgTishi('请选择要查看明细的项！');
		return;
	}
	initXtMonitorCpuFormDetail();
	xtMonitorCpuWinDetail = Ext.create('Ext.Window',{
		layout:'fit',
		width:800,
		height:400,
		maximizable:true,
		minimizable:true,
		animateTarget:document.body,
		plain:true,
		modal:true,
		title:'明细信息',
		listeners:{
			minimize:function(win,opts){
				if(!win.collapse()){
					win.collapse();
				}else{
					win.expand();
				}
			}
		},
		items:xtMonitorCpuFormDetail,
		buttons:[{
			text:'关闭',
			itemId:'close',
			handler:function(button){
				button.up('window').close();
			}
		}]
	});
	xtMonitorCpuWinDetail.show();
	loadFormData(xtMonitorCpuFormDetail,'../xtMonitorCpuController/getXtMonitorCpuById?xt_monitor_cpu_id='+ record.items[0].data.xt_monitor_cpu_id);
}
function initXtMonitorCpuFormDetail(){
	xtMonitorCpuFormDetail = Ext.create('Ext.FormPanel',{
		xtype:'form',
		waitMsgTarget:true,
		defaultType:'textfield',
		autoScroll:true,
		fieldDefaults:{
			labelWidth:70,
			labelAlign:'top',
			flex:1,
			readOnly:true,
			margin:'2 5 4 5'
		},
		items:[
		{
			fieldLabel:'CPUID编号',
			xtype:'textfield',
			hidden:true,
			name:'xt_monitor_cpu_id',
			allowBlank:false,
			maxLength:32,
			anchor:'100%'
		},
		{
			fieldLabel:'CPU的总量MHz（M）',
			xtype:'numberfield',
			value:'0',
			name:'xt_monitor_cpu_totalMHz',
			anchor:'40%'
		},
		{
			fieldLabel:'CPU生产商',
			xtype:'textfield',
			name:'xt_monitor_cpu_producer',
			maxLength:50,
			anchor:'40%'
		},
		{
			fieldLabel:'CPU缓存数量（个）',
			xtype:'textfield',
			name:'xt_monitor_cpu_cache',
			maxLength:20,
			anchor:'40%'
		},
		{
			fieldLabel:'CPU用户使用率（%）',
			xtype:'textfield',
			name:'xt_monitor_cpu_user_use_rate',
			maxLength:10,
			anchor:'40%'
		},
		{
			fieldLabel:'CPU系统使用率（%）',
			xtype:'textfield',
			name:'xt_monitor_cpu_sys_use_rate',
			maxLength:10,
			anchor:'40%'
		},
		{
			fieldLabel:'CPU当前等待率（%）',
			xtype:'textfield',
			name:'xt_monitor_cpu_wait_use_rate',
			maxLength:10,
			anchor:'40%'
		},
		{
			fieldLabel:'CPU当前错误率（%）',
			xtype:'textfield',
			name:'xt_monitor_cpu_error_use_rate',
			maxLength:10,
			anchor:'40%'
		},
		{
			fieldLabel:'CPU当前空闲率（%）',
			xtype:'textfield',
			name:'xt_monitor_cpu_currently_idle',
			maxLength:10,
			anchor:'40%'
		},
		{
			fieldLabel:'CPU总的使用率（%）',
			xtype:'textfield',
			name:'xt_monitor_cpu_use_rate',
			maxLength:10,
			anchor:'40%'
		},
		{
			fieldLabel:'第几模块CPU信息',
			xtype:'numberfield',
			value:'0',
			name:'xt_monitorNum',
			anchor:'40%'
		},
		{
			fieldLabel:'取读时间',
			xtype:'textfield',
			name:'xt_monitor_cpuTime',
			maxLength:20,
			anchor:'40%'
		}
		]
	});
}
